﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;
using CommonModule;
using Microsoft.Practices.Composite.Presentation.Commands;

namespace Services
{
    public enum EnumCommans
    {

    }
    public class AdminCommandService
    {
        public static List<CommandDefinition> GetCommands()
        {
            AdminCommandService objService = new AdminCommandService();
            List<CommandDefinition> CommandCollection=new List<CommandDefinition>();
            CommandDefinition objInvokeCmd = new CommandDefinition 
            {
                MenuName="Add User",
                ViewName="AddUserView",
                MenuCommand = new DelegateCommand<object>(objService.InvokeAddUser)
            };
            CommandDefinition objDelUserCmd = new CommandDefinition 
            {
                MenuName="Delete User",
                ViewName = "DeleteUserView",
                MenuCommand = new DelegateCommand<object>(objService.DeleteUser)
            };

            CommandDefinition objUserDetailCmd = new CommandDefinition 
            {
                MenuName=" User Detail",
                ViewName = "UserDetailView",
                MenuCommand = new DelegateCommand<object>(objService.UserDetails)
            };

            CommandCollection.Add(objInvokeCmd);
            CommandCollection.Add(objDelUserCmd);
            CommandCollection.Add(objUserDetailCmd);

            return CommandCollection;
        }

        public void InvokeAddUser(object parm)
        {
            CommandDefinition objCmdDef = parm as CommandDefinition;
            SingletonRegionService.Instance.ActivateViewInRegion(Regions.Activity, objCmdDef.ViewName);
        }
        public void DeleteUser(object parm)
        {
            CommandDefinition objCmdDef = parm as CommandDefinition;
            SingletonRegionService.Instance.ActivateViewInRegion(Regions.Activity, objCmdDef.ViewName);
        }
        public void UserDetails(object parm)
        {
            CommandDefinition objCmdDef = parm as CommandDefinition;
            SingletonRegionService.Instance.ActivateViewInRegion(Regions.Activity, objCmdDef.ViewName);
        }

    }
}
